3 ...\PTVR_Researchers\Python_Scripts\Demos\Pointing\events_and_callbacks_for_pointing\
4 head_pointing_to_end_trials.py
7 Loop of trials with one scene per trial.
8 You must point at the sphere (whose position changes across trials) with
9 your head to go to the next trial.
32 pointing_activation_disk_radius_deg = 3
35 distance_to_sphere = 3
37 reticle_size_deg = 2 * pointing_activation_disk_radius_deg
50 reticle_2D_image = RG.ReticleImageFromDrawing()
54 image=reticle_2D_image,
55 size_in_degrees=[reticle_size_deg, reticle_size_deg],
56 distance_if_empty_cursor_cone=distance_to_sphere
58 my_scene.place_contingent_cursor(my_reticle)
65 my_world = visual.The3DWorld(name_of_subject=
"nabil")
66 my_world.translate_coordinate_system_along_global(np.array([0, 1.2, 0]))
68 fontsize_in_postscript_points=200,
69 vertical_alignment=
"baseline")
70 text_1.set_cartesian_coordinates(y=-2, z=2)
72 for i
in range(0, nb_of_trials):
75 str(trial_scene.trial),
76 fontsize_in_postscript_points=600,
77 vertical_alignment=
"baseline")
78 trial_text.set_cartesian_coordinates(z=2)
81 color=color.RGBColor(1, 0, 0, 1),
83 my_target_sphere.set_perimetric_coordinates(eccentricity=20,
95 target_is_pointed_at = \
98 target_id=my_target_sphere.id,
102 activation_cone_origin_id=my_world.headset.id,
104 activation_cone_radius_deg=pointing_activation_disk_radius_deg)
107 my_callback_current_scene_end = callback.EndCurrentScene()
110 trial_scene.AddInteraction(events=[target_is_pointed_at],
111 callbacks=[my_callback_current_scene_end])
113 trial_scene.place(trial_text, my_world)
114 trial_scene.place(text_1, my_world)
116 trial_scene.place(my_target_sphere, my_world)
117 my_world.add_scene(trial_scene)
122 if __name__ ==
"__main__":
def LaunchThe3DWorld(jsonFileCategory="Externals")
def create_reticle(my_scene)